﻿<div ng-controller="ProjectDetailsController">
    <br />
    <br />
    <div class="container-fluid" style="border:3px solid SlateGray; width:auto;">
        <h3><strong>Admin Management Console</strong></h3>
        <div class="row" style="padding:10px;">
            <a ng-href="#/ProjectsAll" class="btn btn-default">Projects & Solutions</a>

            <a ng-href="#/AllHardware" class="btn btn-default">Hardware</a>

            <a ng-href="#/AllTickets" class="btn btn-default">Tickets</a>

            <a ng-href="#/AllFAQs" class="btn btn-default">FAQ's</a>

            <a ng-href="#/CustomerContacts" class="btn btn-default">Customer Contacts</a>

            <a ng-href="#/UsersList/" class="btn btn-default">Users</a>
        </div>
    </div>
    <hr />
    <div style="padding-bottom:15px;">
        <h2>All Projects (by Start Date, newest first)</h2>
        <div style="display: inline-block;">
            <a href="#/AddProject/" class="btn btn-primary">Add New Project</a>
        </div>
        <div style="display: inline-block;" class="pull-right">
            <label class="text-info" style="font-size:large">Search:</label>
            <div style="display: inline-block;" class="pull-right">
                <input ng-model="search.$" class="form-control" style="width:400px;" />
            </div>
        </div>
    </div>

    <div ng-repeat="p in Projects | filter:search">
        <div class="well container-fluid">
            <div class="col-md-6">
                <!-- Project Details-->
                <a ng-href="#/ProjectDetails/{{p.ProjectID}}">
                    <h2>{{p.ProjectName}}</h2>
                </a>
                <h4><strong>Name: </strong>{{p.User.Name}}</h4>
                <h4><strong>Company: </strong>{{p.User.Company}}</h4>
                <hr />
                <h4><strong>Start Date: </strong>{{p.StartDate | date:'mediumDate'}}</h4>
                <h4><strong>Target Completion Date: </strong>{{p.TargetDate | date:'mediumDate'}}</h4>
                <h4><strong>Actual Completion Date: </strong>{{p.CompletionDate | date:'mediumDate'}}</h4>
                <h3>Project Location</h3>
                <h4><strong>Address1: </strong>{{p.Address1}}</h4>
                <h4><strong>Address2: </strong>{{p.Address2}}</h4>
                <h4><strong>City: </strong>{{p.City}} &nbsp;<strong>State: </strong>{{p.State}}&nbsp;<strong>Zip: </strong>{{p.Zip}}</h4>
                <h4><strong>Location Notes:</strong></h4>
                <h4>{{p.LocationNotes}}</h4>
                <!-- Project Delete-->
                <!--<button ng-click="DeleteProject(p.ProjectID)" class="btn btn-danger">Delete Project</button>-->
            </div>
            <div ng-show="p.Solutions">
                <div id="#collapseOne" class="col-md-6 panel-collapse collapse in ">
                    <h2 class="panel-title"><strong>Solutions</strong></h2>
                    <div class="panel-body" ng-repeat="s in p.Solutions">
                        <h3><a ng-href="#/SolutionDetails/{{s.SolutionID}}"> {{s.SolutionName}}  </a></h3>
                        <h4><strong> Start Date: </strong>{{s.StartDate | date:'mediumDate'}} </h4>
                        <h4><strong> Urgency: </strong>{{s.Urgency}}</h4>
                        <h4><strong> Target Completion Date: </strong>{{s.TargetCompletionDate | date:'mediumDate'}}</h4>
                        <!-- Solution Delete-->

                        <button ng-click="DeleteSolution(s, p)" class="btn btn-danger">Delete Solution</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>